package com.apes.hr.cultivate.model;

import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.Model;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

/**
 * 培训课程评分标准
 * @author Linwz
 * @create 2019-06-17 15:11
 */
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = CourseLevel.CONST_TABLE_NAME)
public class CourseLevel extends Model {
    public static final String CONST_TABLE_NAME = "hr_course_level";

    @Id
    @Column(name = "id")
    @ApesGenerator(code = CONST_TABLE_NAME, name = "评分标准")
    @Comment("评分标准编码")
    private String id;   //评分标准编码

    @NotNull
    @ManyToOne(optional = false)
    @JoinColumn(name = "course_id", referencedColumnName = "ID")
    @Comment("培训课程")
    private Course course; //培训课程


    @Column(name = "code", length = 120)
    @Comment("显示编码")
    private String code;  //显示编码

    @Column(name = "course_level", length = 16)
    @Comment("等级")
    private String courseLevel;   //等级

    @Column(name = "value_L")
    @Comment("最低分")
    private int valueL;//最低分

    @Column(name = "value_U")
    @Comment("最高分")
    private int valueU;//最高分


}
